package sz.szsmk.citizencard.ui.activity;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Bundle;
import android.os.Handler;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;

import com.chenenyu.router.annotation.Route;
import com.google.gson.Gson;

import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;

import java.util.ArrayList;
import java.util.List;

import sz.szsmk.citizencard.DaggerApplication;
import sz.szsmk.citizencard.R;
import sz.szsmk.citizencard.databinding.BaiduMapActivityBinding;
import sz.szsmk.citizencard.ioc.Compontent.DaggerCommonActivityComponent;
import sz.szsmk.citizencard.log.L;
import sz.szsmk.citizencard.model.network.bean.response.PrepayResponse;
import sz.szsmk.citizencard.mvp.contract.IMapViewContact;
import sz.szsmk.citizencard.mvp.presenter.IMapViewPresenter;
import sz.szsmk.citizencard.ui.base.IBaseActivity;
import sz.szsmk.citizencard.util.Constant;
import sz.szsmk.citizencard.util.JumpUtils;

//import com.baidu.location.BDAbstractLocationListener;

/**
 * Copyright (c)2018
 * author: zdh
 * created on: 2018/7/24 10:47
 * description:
 */
@Route("map")
public class MapviewActivity extends IBaseActivity<IMapViewPresenter, BaiduMapActivityBinding> implements
        IMapViewContact.IMapViewView, View.OnClickListener {


    private SDKReceiver mReceiver;
    private TextView title;
    private ArrayList<PrepayResponse.WebsiteListInfoBean> websiteListInfo = new ArrayList<>();
    private String serviceType;
    private String siteType;

    @Override
    protected int attachLayoutRes() {
        return R.layout.baidu_map_activity;
    }

    @Override
    public void getServiceNetSucc(final List<PrepayResponse.WebsiteListInfoBean> websiteListInfo) {
    }

    @Override
    public void getServiceNetFail(PrepayResponse response) {

    }

    /**
     * 构造广播监听类，监听 SDK key 验证以及网络异常广播
     */
    public class SDKReceiver extends BroadcastReceiver {
        public void onReceive(Context context, Intent intent) {
        }
    }

    @Override
    protected void initInjector() {
        DaggerCommonActivityComponent.builder().appCompontent(DaggerApplication.getAppComponent())
                .build().inject(this);
    }

    @Override
    protected void initViews() {

    }

    /**
     * 绘制点
     *
     * @param index
     * @param bean
     * @return
     */
    @Override
    public void onClick(View v) {
        if (v.getId() == R.id.back) {
            finish();
        }
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        unregisterReceiver(mReceiver);
    }

    @Override
    public void onStart() {
        super.onStart();
        EventBus.getDefault().register(this);
    }

    @Override
    public void onStop() {
        EventBus.getDefault().unregister(this);
        super.onStop();
    }

    @Override
    protected void onResume() {
        super.onResume();
    }

    @Override
    protected void onPause() {
        super.onPause();
    }

    @Override
    protected void updateViews() {

    }
}
